﻿using ConfExpert.Forms.Base;
using DevTeam;
using System;

namespace ConfExpert.Forms.Depo.Texcomm
{
    public partial class ModelDetay : XForm
    {
        public ModelDetay()
        {
            InitializeComponent();
        }
        
        private void ModelDetay_Load(object sender, EventArgs e)
        {
            
            gvModel.Init("GetTexcommModelDetail");

            gvModel.SetCaptions("Yaka:Yaka İsmi/No", "Manset:Manşet İsmi/No");
            
            gvModel.OptionsView.NewItemRowPosition = DevExpress.XtraGrid.Views.Grid.NewItemRowPosition.Bottom;
            btnKaydet.ItemClick += btnKaydet_ItemClick;
            gvModel.BestFitColumns();

            //TAM.TexcommGarniPosTableAdapter = new Datasets.MyDataTableAdapters.TexcommGarniPosTableAdapter();
            //bs = new BindingSource(ds, "TexcommGarniPos");
            //AddBsToList(bs);
            //InitGridView(gvModel, bs);

            //gvModel.OptionsView.NewItemRowPosition = DevExpress.XtraGrid.Views.Grid.NewItemRowPosition.Bottom;

            //TAM.TexcommGarniPosTableAdapter.Fill(ds.TexcommGarniPos);
            //gvModel.BestFitColumns();
        }

        void btnKaydet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            gvModel.EndEditing();
            if (gvModel.Dataset().HasChanges())
                gvModel.Update();
        }
    }
}